package v3.chapter1.t12;

public class Run {

	public static void main(String[] args) {
		try {
			MyThread mythread=new MyThread();
			mythread.start();
			Thread.sleep(1000);
			mythread.interrupt();
			
			System.out.println("是否停止 1 ？ ="+mythread.interrupted());
			System.out.println("是否停止 2？ ="+mythread.interrupted());
		}catch(InterruptedException e) {
			System.out.println("main catch");
			e.printStackTrace();
		}

		System.out.println("end!");
	}

}

class MyThread extends Thread {

	@Override
	public void run() {
		super.run();
		for (int i = 0; i < 500000; i++) {
			System.out.println("i=" + (i + 1));
		}
	}

}